#' Zones exploitables
#'
#' @description Affichage des zones exploitables (pente<0.30) par tracteur sur le MNT
#'
#' @return La fonction renvoit le MNT
#'
#' @param r = un modèle numérique de terrain
#' @param shp = la route au format sf
#'
#' @import sf
#' @import tidyverse
#' @import raster
#' @import sp
#'
#' @author Max Bruciamacchie
#'
#'
#'
#' @export
#'
ExploiTracteur <- function(r,shp){
zone <- st_buffer(shp, dist=100)
r <- crop(r, as(zone, "Spatial"))
pente <- terrain(r, opt="slope", unit="tangent", neighbors=8)
pente[pente > 0.3] <- NA
pente[pente <= 0.3] <- 1
route <- st_buffer(shp, dist=3)
return(plot(slope))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.